/*
 * main.c
 *
 *  Created on: 21.12.2012
 *      Author: Michael
 */
#include "LinkedList.h"
#include <stdlib.h>

int main(int argc, char** argv) {
	/* variable declaration */
	Node_t* first;
	Node_t* second;
	Node_t* third;
	Node_t* fourth;
	LinkedList_t* list;

	/* init the first node */
	first = malloc(sizeof(Node_t*));
	first->_value = 5;

	/* init the second node */
	second = malloc(sizeof(Node_t*));
	second->_value = 8;

	/* init the third node */
	third = malloc(sizeof(Node_t*));
	third->_value = 10;

	/* init the third node */
	fourth = malloc(sizeof(Node_t*));
	fourth->_value = 1;

	/* init the list */
	list = createList();
	list->add(list, first);
	list->add(list, second);

	/*
	 * Estimated result:
	 * [0] 5
	 * [1] 8
	 */
	list->print(list);

	list->set(list, third, 1);

	/*
	 * Estimated result:
	 * [0] 5
	 * [1] 10
	 * [2] 8
	 */
	list->print(list);

	list->set(list, fourth, 0);

	/*
	 * Estimated result:
	 * [0] 1
	 * [1] 5
	 * [2] 10
	 * [3] 8
	 */
	list->print(list);

	return 0;
}
